#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

//int my_strcmp(const char* str, const char* str1) {
//	while (*str == *str1) {
//		if (*str == '\0')
//			return 0;
//		str++;
//		str1++;
//	}
//	return *str - *str1;
//}

char* my_strstr(const char* str, const char* str1) {
	char* s1 = NULL;
	char* s2 = NULL;
	char* cur = str;
	while (*cur) {
		s1 = cur;
		s2 = str1;
		while (*s1!='\0'&&*s2!='\0'&& * s1 == *s2) {
			s1++;
			s2++;
		}
		if (*s2 == '\0')
			return cur;
		cur++;
	}
	return NULL;
}

int main() {
	char* str = "aabcdef";
	char* str1 = "abcd";
	//int ret =my_strcmp(str, str1);
	//printf("%d", ret);
	char* s=my_strstr(str, str1);
	printf("%s", s);
}